package cloud.maque.querylist.dal.impl;

import cloud.maque.querylist.dal.domain.entity.Room;
import cloud.maque.querylist.dal.interfaces.RoomService;
import cloud.maque.querylist.dal.mapper.RoomMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomServiceImpl extends ServiceImpl<RoomMapper, Room> implements RoomService {


    @Override
    public List<Room> roomList() {
        QueryWrapper qw = new QueryWrapper();
        List<Room> result = this.list(qw);
        return result;
    }

    @Override
    public Room roomAdd(Room room) {
        this.saveOrUpdate(room);
        return room;
    }
}
